{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# Prediction for a Continuous Waveform using the Transfer-learned PhaseNet\n",
    "## 1. Download demo data (if you have downloaded it in the previous tutorial, you can skip it)\n",
    "```bash\n",
    "cd TLPN\n",
    "wget https://github.com/JUNZHU-SEIS/TLPN/releases/download/1.0.0/test_data.tar\n",
    "unzip test_data.zip\n",
    "```\n",
    "## 2. Predict a continuous waveform\n",
    "TLPN currently only supports sac format\n",
    "```bash\n",
    "python tlpn/pickcontinuoussac.py --fname=\"dataset/sac/SC.JLO.201336516025.00.BH*\" --result_dir=results --model=model/tlstead.pt\n",
    "```\n",
    "Then you will see a new folder named \"results\" in your current path.\n",
    "* The waveform and corresponding response are plotted in this subfolder, \"results/figures/\".\n",
    "* The predicted P and S arrival time, or the picks, are appended to the file, \"results/picks.csv\".\n",
    "* You can pick the phases in other waveforms by running the code snippet above, as long as you don't change the ${result_dir}. The new picks will be appended to the same file, \"result/picks.csv. And the corresponding figures will be saved in the same subfolder, \"results/figures/\".\n",
    "\n",
    "*Note: DO NOT skip the double quotation marks when assigning a path for the --fname.*\n",
    "\n",
    "Example output:\n",
    "![response](https://raw.githubusercontent.com/JUNZHU-SEIS/TLPN/master/docs/demo/figures/SC_JLO_2013-12-31T16%3A02%3A05.280000Z.png)"
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.8.10"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 4
}
